package cn.test;
//静态内部类单例模式
public class Singleton {
    private static class SingletonHolder{
        private static final Singleton INSTANCE=new Singleton();
    }
    private Singleton(){

    }
    //A,B
    public static final Singleton getInstance(){
        return SingletonHolder.INSTANCE;
    }
    public void show(){
        System.out.println("单例模式show");
    }
}
